//
//  NSString+Base64.m
//  Y2NetWorking
//
//  Created by ycgame on 2020/11/23.
//

#import "NSString+Y2Base64.h"

@implementation NSString (Y2Base64)

- (NSString *) y2Base64String {
    NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding];
    NSString *base64String = [data base64EncodedStringWithOptions:0];
    return base64String;
}

- (NSString *) y2Base64DecodedString {
    NSData *data = [[NSData alloc] initWithBase64EncodedString:self options:0];
    NSString *originString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    return originString;
}

@end
